------------------------------------------------------------------------------------------------------
       log:  C:\DATA\pres_runoff.log
  log type:  text
 opened on:  18 May 2005, 10:04:20

.  #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      pres_runoff.do                                  *;
. *       Date:           5/18/05                                         *;
. *       Author:         MRG                                             *;
. *       Purpose:        Do-file to replicate results for AJPS version   *;
. *                       of presidential candidates paper where          *;
. *                       dependent variable is presidential candidates.  *;
. *                       Tables 2 and 3.  Also does first part of        *;
. *                       Afghanistan example.                            *;
. *       Input File:     presidential_new.dta                            *;
. *       Output File:    pres_runoff.log                                 *;
. *       Data Output:    None                                            *;
. *       Previous file:                                                  *;
. *       Machine:        Office                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

. set matsize 150;

. use c:\ajps\presidential_new.dta;

. *     ****************************************************************  *;
. *                           Summary Statistics                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       294    87.93197    41.47686          3        198
        year |       294    1980.588     16.4538       1946       2000
    eighties |       294    .0884354    .2844111          0          1
    nineties |       294    .2040816    .4037161          0          1
-------------+--------------------------------------------------------
         old |       294     .755102    .4307599          0          1
         cox |        17           1           0          1          1
  enpres_cox |        17    3.129412    1.107172       1.96       5.69
   eneth_cox |        17    1.642941    .7725588       1.01       3.77
      avemag |       276    10.88268     21.9662          1        150
-------------+--------------------------------------------------------
 coexistence |       294    .0204082     .141633          0          1
 conditional |       294           0           0          0          0
  correction |       294    .0170068    .1295169          0          1
      dhondt |       294    .1734694    .3792982          0          1
   districts |       277    75.43321    128.4021          1        577
-------------+--------------------------------------------------------
       droop |       294           0           0          0          0
 elec_system |         0
electorals~r |       278    2.028777    1.656156          1         12
        eneg |       252    2.021872    1.169619   1.004012   8.176613
        enep |       255    3.842745    1.869934       1.35      13.77
-------------+--------------------------------------------------------
 enep_others |       252    3.523333    8.256753          0       66.5
       enep1 |       251    4.347012    4.031235       1.35       46.1
        enpp |       271     3.17786    1.358342       1.12       8.76
 enpp_others |       261    2.320307    8.421831          0         86
       enpp1 |       261    4.114444    11.25567       1.12     178.65
-------------+--------------------------------------------------------
      enpres |       289    2.772965    1.137473          1       6.57
     ethfrac |       251    .2888048    .2518241        .01         .9
    ethfrac2 |       241     .281069    .2503868   .0021882   .8687042
    ethfracn |       251    .4360558     .257955        .01        .91
    ethkrain |       171    .3587719    .2454005        .01        .84
-------------+--------------------------------------------------------
fractional~n |       252    .3951362    .2232332    .003996      .8777
       fused |       294    .1088435    .3119738          0          1
      fusion |       294    .0034014    .0583212          0          1
        hare |       294    .2278912    .4201872          0          1
   imperiali |       294           0           0          0          0
-------------+--------------------------------------------------------
 institution |       294    2.527211     .704162          1          3
instit~n_lag |       288    2.121528    1.111778          0          3
institution2 |       279    2.530466    .7134147          1          3
instit~2_lag |       288    2.131944     1.10587          0          3
leg_altern~e |       294           0           0          0          0
-------------+--------------------------------------------------------
   leg_borda |       294           0           0          0          0
 leg_limited |       294    .0068027    .0823377          0          1
leg_majority |       294    .0612245    .2401504          0          1
leg_plural~y |       294    .1632653    .3702377          0          1
leg_qualma~y |       294           0           0          0          0
-------------+--------------------------------------------------------
  leg_runoff |       281    .1174377    .3225155          0          1
    leg_sntv |       294           0           0          0          0
     legelec |       294    .6598639    .4745625          0          1
majoritarian |       294    .1734694    .3792982          0          1
      medmag |       215    12.84651    24.88801          1        150
-------------+--------------------------------------------------------
       mixed |       294    .0578231    .2338067          0          1
mixed_depe~t |       294    .0102041    .1006699          0          1
   mod_droop |       294           0           0          0          0
    mod_hare |       294           0           0          0          0
mod_sainte~e |       294           0           0          0          0
-------------+--------------------------------------------------------
       multi |       294    .0782313    .2689931          0          1
multi_linked |       294    .0442177    .2059289          0          1
      newdem |       294    .1836735    .3878779          0          1
      number |       179    6.860335    10.75036          1         53
pres_college |       294     .085034    .2794079          0          1
-------------+--------------------------------------------------------
pres_major~y |       294    .3673469    .4829041          0          1
pres_plura~y |       294    .3673469    .4829041          0          1
pres_qualm~y |       294    .1428571    .3505237          0          1
 pres_runoff |       294    .5102041    .5007482          0          1
    pres_stv |       294     .037415       .1901          0          1
-------------+--------------------------------------------------------
    preselec |       294           1           0          1          1
proportional |       294    .3503401    .4778899          0          1
  proximity1 |       194    .9948454    .0717958          0          1
  proximity2 |       196    .9846939    .1230818          0          1
      regime |       294    .0238095    .1527153          0          1
-------------+--------------------------------------------------------
  regime_lag |       288      .15625    .3637242          0          1
  regime_leg |       294           0           0          0          0
      region |       294    7.173469    2.610136          1         10
     region1 |       294    7.078231    2.540592          1         10
reinforced~i |       294           0           0          0          0
-------------+--------------------------------------------------------
        reld |       292    .2802092    .1804728    .005982    .733386
    relfracn |       254    .2609843    .2239393        .01        .83
 saintelague |       294    .0034014    .0583212          0          1
       seats |       286    168.8986    125.8949         16        577
         stv |       294    .0068027    .0823377          0          1
-------------+--------------------------------------------------------
superposit~n |       294    .0204082     .141633          0          1
  upperseats |       278    10.10791    30.82914          0        225
   uppertier |       278    5.623741    12.23941          0      77.95
 enep_higher |       248    4.349798    4.056787       1.35      46.17
  enep_lower |       248    4.343226    4.043032       1.35      46.03
-------------+--------------------------------------------------------
 enpp_higher |       256    4.574961    17.81524       1.12     283.24
  enpp_lower |       256     3.69832    5.161631       1.12      74.05
preselecsy~m |       293     2.05802    1.088567          1          5

. *     ****************************************************************  *;
. *                    Relabel and Define Variables                       *;
. *     ****************************************************************  *;
. label var country  "countryname";

. label var newdem "first election as new democracy";

. label var countrynumber "countrynumber";

. label var year "year";

. label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";

. label var regime_leg "regime type at time of legislative election 0 = democracy 1=dictatorship";

. label var legelec "legislative election";

. label var preselec "presidential election";

. label var eighties "election in 1980s closest to 1985";

. label var old "elections in countries that did not transition to democracy in 1990s";

. label var nineties "elections in 1990s closest to 1995";

. label var proximity1 "proximity - continuous";

. label var proximity2 "proximity - dichotomous";

. label var enpp "parliamentary parties - uncorrected";

. label var enpp1 "parliamentary parties - corrected";

. label var enep "electoral parties - uncorrected";

. label var enep1 "electoral parties - corrected";

. label var enpres "effective number of presidential candidates";

. label var seats "assembly size";

. label var districts "number of electoral districts";

. label var avemag "average district magnitude";

. label var medmag "median district magnitude";

. label var upperseats "number of uppertier seats";

. label var uppertier "percentage of uppertier seats";

. label var eneg "effective number of ethnic groups  fearon";

. describe;

Contains data from c:\ajps\presidential_new.dta
  obs:           294                          
 vars:            88                          24 May 2004 10:46
 size:        64,680 (99.4% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str24  %24s                   countryname
countrynumber   int    %8.0g                  countrynumber
year            int    %8.0g                  year
eighties        byte   %8.0g                  election in 1980s closest to
                                                1985
nineties        byte   %8.0g                  elections in 1990s closest to
                                                1995
old             byte   %8.0g                  elections in countries that did
                                                not transition to democracy in
                                                1990s
cox             byte   %8.0g                  
enpres_cox      float  %9.0g                  
eneth_cox       float  %9.0g                  
avemag          float  %9.0g                  average district magnitude
coexistence     byte   %8.0g                  
conditional     byte   %8.0g                  
correction      byte   %8.0g                  
dhondt          byte   %8.0g                  d'hondt
districts       int    %8.0g                  number of electoral districts
droop           byte   %8.0g                  
elec_system     str29  %29s                   
electoralsyst~r byte   %8.0g                  
eneg            float  %9.0g                  effective number of ethnic
                                                groups  fearon
enep            float  %9.0g                  electoral parties - uncorrected
enep_others     float  %9.0g                  
enep1           float  %9.0g                  electoral parties - corrected
enpp            float  %9.0g                  parliamentary parties -
                                                uncorrected
enpp_others     float  %9.0g                  
enpp1           float  %9.0g                  parliamentary parties -
                                                corrected
enpres          float  %9.0g                  effective number of
                                                presidential candidates
ethfrac         float  %9.0g                  
ethfrac2        float  %9.0g                  
ethfracn        float  %9.0g                  
ethkrain        float  %9.0g                  
fractionaliza~n float  %9.0g                  
fused           byte   %8.0g                  
fusion          byte   %8.0g                  
hare            byte   %8.0g                  
imperiali       byte   %8.0g                  
institution     byte   %8.0g                  
institution_lag byte   %8.0g                  
institution2    byte   %8.0g                  
institution2_~g byte   %8.0g                  
leg_alternative byte   %8.0g                  
leg_borda       byte   %8.0g                  
leg_limited     byte   %8.0g                  
leg_majority    byte   %8.0g                  
leg_plurality   byte   %8.0g                  
leg_qualmajor~y byte   %8.0g                  
leg_runoff      byte   %8.0g                  
leg_sntv        byte   %8.0g                  
legelec         byte   %8.0g                  legislative election
majoritarian    byte   %8.0g                  
medmag          float  %9.0g                  median district magnitude
mixed           byte   %8.0g                  
mixed_dependent byte   %8.0g                  
mod_droop       byte   %8.0g                  
mod_hare        byte   %8.0g                  
mod_saintelague byte   %8.0g                  mod_sainte-lague
multi           byte   %8.0g                  
multi_linked    byte   %8.0g                  
newdem          byte   %8.0g                  first election as new democracy
number          byte   %8.0g                  
pres_college    byte   %8.0g                  
pres_majority   byte   %8.0g                  
pres_plurality  byte   %8.0g                  
pres_qualmajo~y byte   %8.0g                  
pres_runoff     byte   %8.0g                  
pres_stv        byte   %8.0g                  
preselec        byte   %8.0g                  presidential election
proportional    byte   %8.0g                  
proximity1      byte   %8.0g                  proximity - continuous
proximity2      byte   %8.0g                  proximity - dichotomous
regime          byte   %8.0g                  regime as of 31 December of
                                                given year 0=democracy
                                                1=dictatorship
regime_lag      byte   %8.0g                  
regime_leg      byte   %8.0g                  regime type at time of
                                                legislative election 0 =
                                                democracy 1=dictatorship
region          byte   %8.0g                  
region1         byte   %8.0g                  
reinforced_im~i byte   %8.0g                  
reld            float  %9.0g                  
relfracn        float  %9.0g                  
saintelague     byte   %8.0g                  sainte-lague
seats           int    %8.0g                  assembly size
stv             byte   %8.0g                  
superposition   byte   %8.0g                  
upperseats      int    %8.0g                  number of uppertier seats
uppertier       float  %9.0g                  percentage of uppertier seats
enep_higher     float  %9.0g                  
enep_lower      float  %9.0g                  
enpp_higher     float  %9.0g                  
enpp_lower      float  %9.0g                  
preselecsystem  byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  

. sum preselec if pres_plurality==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |       108           1           0          1          1

. sum preselec if pres_majority==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |       108           1           0          1          1

. sum preselec if pres_qualmaj==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |        42           1           0          1          1

. sum preselec if pres_stv==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |        11           1           0          1          1

. sum preselec if pres_college==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |        25           1           0          1          1

. sum preselec if pres_runoff==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    preselec |       150           1           0          1          1

. *     ****************************************************************  *;
. *       Would like to drop certain countries that do not fit.           *;
. *       1. Drop Kiribati - not free entry of candidates                 *;
. *       2. Drop elections that ultimately use an electoral college      *;
. *       to determine who wins.  This means dropping Argentina 1946,     *;
. *       1958, 1963, 1983, 1989, United States (all presidential         *;
. *       elections), Finland 1950, 1956, 1962, 1968, 1978, 1982.         *;
. *       3. Drop Ireland (all presidential elections) and Sri Lanka      *;
. *       1994, 1999 since they use STV.                                  *;
. *     ****************************************************************  *;
. drop if countrynumber==163;
(6 observations deleted)

. drop if countrynumber==65;
(14 observations deleted)

. drop if countrynumber==113;
(9 observations deleted)

. drop if countrynumber==96;
(2 observations deleted)

. drop if countrynumber==66 & year==1946;
(1 observation deleted)

. drop if countrynumber==66 & year==1958;
(1 observation deleted)

. drop if countrynumber==66 & year==1963;
(1 observation deleted)

. drop if countrynumber==66 & year==1983;
(1 observation deleted)

. drop if countrynumber==66 & year==1989;
(1 observation deleted)

. drop if countrynumber==106 & year==1950;
(1 observation deleted)

. drop if countrynumber==106 & year==1956;
(1 observation deleted)

. drop if countrynumber==106 & year==1962;
(1 observation deleted)

. drop if countrynumber==106 & year==1968;
(1 observation deleted)

. drop if countrynumber==106 & year==1978;
(1 observation deleted)

. drop if countrynumber==106 & year==1982;
(1 observation deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       252    86.46429    42.44475          3        198
        year |       252    1981.444    16.41157       1946       2000
    eighties |       252    .0833333    .2769354          0          1
    nineties |       252    .2222222    .4165671          0          1
-------------+--------------------------------------------------------
         old |       252    .7222222    .4487946          0          1
         cox |        14           1           0          1          1
  enpres_cox |        14        3.21    1.154749       1.96       5.69
   eneth_cox |        14    1.721429    .8333607       1.01       3.77
      avemag |       234    11.99073    23.61834          1        150
-------------+--------------------------------------------------------
 coexistence |       252    .0238095    .1527587          0          1
 conditional |       252           0           0          0          0
  correction |       252    .0198413    .1397322          0          1
      dhondt |       252    .1865079    .3902912          0          1
   districts |       235    59.85957    105.8381          1        577
-------------+--------------------------------------------------------
       droop |       252           0           0          0          0
 elec_system |         0
electorals~r |       236    2.072034    1.518363          1         12
        eneg |       216    2.102011    1.236922   1.004012   8.176613
        enep |       219    3.958128    1.921759       1.35      13.77
-------------+--------------------------------------------------------
 enep_others |       216    3.644537    8.811978          0       66.5
       enep1 |       215    4.543023    4.289694       1.35       46.1
        enpp |       235    3.230936    1.381874       1.12       8.76
 enpp_others |       225    2.454222    9.009875          0         86
       enpp1 |       225    4.317956     12.1053       1.12     178.65
-------------+--------------------------------------------------------
      enpres |       250    2.791039    1.109777          1       6.57
     ethfrac |       215    .2868837    .2603378        .01         .9
    ethfrac2 |       205    .2877573    .2643915   .0021882   .8687042
    ethfracn |       215    .4480465    .2599765        .01        .91
    ethkrain |       141     .402695    .2432837        .01        .84
-------------+--------------------------------------------------------
fractional~n |       216    .4085254    .2299759    .003996      .8777
       fused |       252    .1269841    .3336178          0          1
      fusion |       252           0           0          0          0
        hare |       252     .265873    .4426762          0          1
   imperiali |       252           0           0          0          0
-------------+--------------------------------------------------------
 institution |       252    2.599206    .6390975          1          3
instit~n_lag |       246    2.174797    1.116634          0          3
institution2 |       238    2.609244    .6452019          1          3
instit~2_lag |       246    2.186992    1.109143          0          3
leg_altern~e |       252           0           0          0          0
-------------+--------------------------------------------------------
   leg_borda |       252           0           0          0          0
 leg_limited |       252           0           0          0          0
leg_majority |       252     .047619    .2133827          0          1
leg_plural~y |       252    .1309524    .3380196          0          1
leg_qualma~y |       252           0           0          0          0
-------------+--------------------------------------------------------
  leg_runoff |       239    .1129707    .3172213          0          1
    leg_sntv |       252           0           0          0          0
     legelec |       252    .6547619     .476392          0          1
majoritarian |       252    .1150794    .3197528          0          1
      medmag |       180        14.6    26.79215          1        150
-------------+--------------------------------------------------------
       mixed |       252    .0634921    .2443312          0          1
mixed_depe~t |       252    .0119048    .1086734          0          1
   mod_droop |       252           0           0          0          0
    mod_hare |       252           0           0          0          0
mod_sainte~e |       252           0           0          0          0
-------------+--------------------------------------------------------
       multi |       252    .0912698    .2885656          0          1
multi_linked |       252    .0515873    .2216325          0          1
      newdem |       252    .1944444      .39656          0          1
      number |       150    3.773333    3.399855          1         15
pres_college |       252           0           0          0          0
-------------+--------------------------------------------------------
pres_major~y |       252    .4285714    .4958565          0          1
pres_plura~y |       252    .4047619    .4918227          0          1
pres_qualm~y |       252    .1666667    .3734196          0          1
 pres_runoff |       252    .5952381    .4918227          0          1
    pres_stv |       252           0           0          0          0
-------------+--------------------------------------------------------
    preselec |       252           1           0          1          1
proportional |       252    .3849206    .4875449          0          1
  proximity1 |       165    .9939394    .0778499          0          1
  proximity2 |       167    .9820359    .1332203          0          1
      regime |       252    .0277778    .1646626          0          1
-------------+--------------------------------------------------------
  regime_lag |       246    .1666667    .3734378          0          1
  regime_leg |       252           0           0          0          0
      region |       252    6.944444    2.578815          1         10
     region1 |       252    6.944444    2.578815          1         10
reinforced~i |       252           0           0          0          0
-------------+--------------------------------------------------------
        reld |       250    .2640121      .16881    .005982    .733386
    relfracn |       218    .2446789    .2105559        .01        .83
 saintelague |       252    .0039683    .0629941          0          1
       seats |       244    155.4672    117.4702         16        577
         stv |       252           0           0          0          0
-------------+--------------------------------------------------------
superposit~n |       252    .0238095    .1527587          0          1
  upperseats |       236    11.66102    33.12779          0        225
   uppertier |       236    6.515339    13.03632          0      77.95
 enep_higher |       212    4.548868    4.321184       1.35      46.17
  enep_lower |       212    4.541557    4.306305       1.35      46.03
-------------+--------------------------------------------------------
 enpp_higher |       220    4.858455    19.20326       1.12     283.24
  enpp_lower |       220    3.838545    5.537672       1.12      74.05
preselecsy~m |       251    1.760956    .7145834          1          3

. sum countrynumber if enpres>0 & enpres<200 & eneg>0 & eneg<200;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
countrynum~r |       214    83.27103    38.93912          3        187

.  sum countrynumber if enpres>0 & eneg>0 & eneg<300 & enpres<200 & pres_runoff==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
countrynum~r |       135    88.62963    44.27859          3        187

. sum countrynumber if enpres>0 & eneg>0 & eneg<300 & enpres<200 & pres_plurality==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
countrynum~r |        79    74.11392    25.25307         12        176

. sum enpres if enpres>0 & enpres<200 & eneg>0 & eneg<200;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      enpres |       214    2.899672    1.071094          1       6.57

. sum eneg if enpres>0 & enpres<200 & eneg>0 & eneg<200;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        eneg |       214    2.101349    1.239312   1.004012   8.176613

. *     ****************************************************************  *;
. *       214 presidential elections left. 135 runoff, 79 plurality       *;
. *       53 countries                                                    *;
. *     ****************************************************************  *;
. sum enpres if eighties==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      enpres |        21    2.931905    1.218748          1       5.69

. sum enpres if nineties==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      enpres |        56    3.181429    1.222743       1.17       6.12

. *     ****************************************************************  *;
. *       21 countries had presidential elections in the 1980s.           *;
. *       56 countries had presidential elections in the 1990s.           *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Let's see what the differences are between the cox data for     *;
. *       1980s and the data that I collected.                            *;
. *     ****************************************************************  *;
. correlate enpres_cox enpres;
(obs=14)

             | enpres~x   enpres
-------------+------------------
  enpres_cox |   1.0000
      enpres |   0.9509   1.0000


. correlate eneth_cox eneg;
(obs=12)

             | eneth_~x     eneg
-------------+------------------
   eneth_cox |   1.0000
        eneg |   0.9891   1.0000


. *     ****************************************************************  *;
. *           The correlations are actually quite high i.e. 95-99%        *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                   Create variables ready for regressions              *;
. *     ****************************************************************  *;
. gen eneg_runoff = eneg*pres_runoff;
(36 missing values generated)

. *     ****************************************************************  *;
. *                               1980s                                   *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff  eneg_runoff if eighties==1, robust;

Regression with robust standard errors                 Number of obs =      18
                                                       F(  3,    14) =    4.82
                                                       Prob > F      =  0.0165
                                                       R-squared     =  0.4794
                                                       Root MSE      =   .9657

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |   .1073367   .1239648     0.87   0.401    -.1585414    .3732148
 pres_runoff |    .321737   .8141723     0.40   0.699    -1.424489    2.067963
 eneg_runoff |   .5422502   .3300719     1.64   0.123    -.1656836    1.250184
       _cons |    2.08582   .4134978     5.04   0.000     1.198955    2.972684
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.64958688

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.30590874

. scalar t=conb/conse;

. display t;
2.1234662

. *     ****************************************************************  *;
. *           What is the effect of eneg as runoff changes in the 1980s?  *;
. *           When runoff is 0, then the effect of eneg is 0.11 (0.12)    *;
. *           When runoff is 1, then the effect of eneg is 0.65 (0.31)    *;
. *           When runoff is 1, eneg is significant at the 90% level and  *;
. *           very close to 95%.                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                               1990s                                   *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if nineties==1, robust;

Regression with robust standard errors                 Number of obs =      49
                                                       F(  3,    45) =    3.52
                                                       Prob > F      =  0.0223
                                                       R-squared     =  0.0833
                                                       Root MSE      =  1.1812

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.2523976    .121702    -2.07   0.044    -.4975181   -.0072771
 pres_runoff |  -.8157799    .571637    -1.43   0.160    -1.967116    .3355561
 eneg_runoff |   .4386924   .1509718     2.91   0.006     .1346196    .7427653
       _cons |    3.62873   .4758803     7.63   0.000     2.670258    4.587202
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.18629483

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.08933702

. scalar t=conb/conse;

. display t;
2.0853038

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.25 (0.12).            *;
. *       Effect of eneg in runoff systems is 0.19 (0.09).                *;
. *       Thus, eneg is significant at 90% level when runoff=1            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Now move on to pooled analyses                                  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                            Full Sample                                *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff, robust cluster(country);

Regression with robust standard errors                 Number of obs =     214
                                                       F(  3,    52) =    6.78
                                                       Prob > F      =  0.0006
                                                       R-squared     =  0.1297
Number of clusters (country) = 53                      Root MSE      =  1.0063

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.0839478   .0746408    -1.12   0.266    -.2337254    .0658298
 pres_runoff |  -.4578015   .2870728    -1.59   0.117    -1.033855    .1182522
 eneg_runoff |   .4193614   .1165628     3.60   0.001     .1854609    .6532619
       _cons |   2.820517   .1722035    16.38   0.000     2.474965    3.166069
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.33541357

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.10542787

. scalar t=conb/conse;

. display t;
3.1814506

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.08 (0.07).            *;
. *       Effect of eneg in runoff systems is 0.34 (0.11).                *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                       Established Democracies                         *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if old==1, robust cluster(country);

Regression with robust standard errors                 Number of obs =     152
                                                       F(  3,    25) =    4.83
                                                       Prob > F      =  0.0087
                                                       R-squared     =  0.1989
Number of clusters (country) = 26                      Root MSE      =  .96534

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.0555274   .1304808    -0.43   0.674    -.3242577    .2132028
 pres_runoff |  -.8550845   .4748407    -1.80   0.084    -1.833037    .1228683
 eneg_runoff |   .6549428   .2225918     2.94   0.007     .1965064    1.113379
       _cons |   2.792922   .2542682    10.98   0.000     2.269247    3.316597
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.59941536

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.19605614

. scalar t=conb/conse;

. display t;
3.0573658

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.06 (0.13).            *;
. *       Effect of eneg in runoff systems is 0.60 (0.20).                *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *    Presidential Regimes: Not shown in Tables 2 or 3                   *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if institution==3, robust cluster(country);

Regression with robust standard errors                 Number of obs =     154
                                                       F(  3,    32) =    3.77
                                                       Prob > F      =  0.0200
                                                       R-squared     =  0.1589
Number of clusters (country) = 33                      Root MSE      =  .97904

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.1034385   .0750404    -1.38   0.178    -.2562909    .0494138
 pres_runoff |  -.8992294   .4095824    -2.20   0.035    -1.733522   -.0649373
 eneg_runoff |   .5959211   .2015793     2.96   0.006     .1853176    1.006525
       _cons |   2.891531   .1778177    16.26   0.000     2.529329    3.253734
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.49248257

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.19507055

. scalar t=conb/conse;

. display t;
2.5246382

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.10 (0.08).            *;
. *       Effect of eneg in runoff systems is 0.49 (0.20).                *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                       Established Presidential Regimes                *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if institution==3 & old==1, robust cluster(country);

Regression with robust standard errors                 Number of obs =     126
                                                       F(  3,    21) =    4.22
                                                       Prob > F      =  0.0176
                                                       R-squared     =  0.2569
Number of clusters (country) = 22                      Root MSE      =  .90763

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.0767863   .1280388    -0.60   0.555    -.3430574    .1894849
 pres_runoff |  -1.243922   .4728997    -2.63   0.016     -2.22737    -.260473
 eneg_runoff |   .7662285   .2365541     3.24   0.004     .2742872     1.25817
       _cons |   2.862523   .2492886    11.48   0.000     2.344099    3.380947
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.68944218

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.21202034

. scalar t=conb/conse;

. display t;
3.2517737

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.08 (0.13).            *;
. *       Effect of eneg in runoff systems is 0.69 (0.21).                *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Afghanistan example                                             *;
. *     ****************************************************************  *;
. regress enpres pres_runoff eneg eneg_runoff if old==1, robust cluster(country);

Regression with robust standard errors                 Number of obs =     152
                                                       F(  3,    25) =    4.83
                                                       Prob > F      =  0.0087
                                                       R-squared     =  0.1989
Number of clusters (country) = 26                      Root MSE      =  .96534

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 pres_runoff |  -.8550845   .4748407    -1.80   0.084    -1.833037    .1228683
        eneg |  -.0555274   .1304808    -0.43   0.674    -.3242577    .2132028
 eneg_runoff |   .6549428   .2225918     2.94   0.007     .1965064    1.113379
       _cons |   2.792922   .2542682    10.98   0.000     2.269247    3.316597
------------------------------------------------------------------------------

. generate JH=((_n-1)/10);

. replace JH=. if _n>60;
(192 real changes made, 192 to missing)

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. gen conb=b1+b3*JH if _n<60;
(193 missing values generated)

. set more off;

. gen conse=sqrt(varb1+varb3*JH^2+2*covb1b3*JH)  if _n<60;
(193 missing values generated)

.  set more off;

. gen a=1.96*conse;
(193 missing values generated)

.  gen top=conb+a;
(193 missing values generated)

.  gen bottom=conb-a;
(193 missing values generated)

. set textsize 100;

. graph twoway  line conb JH, clwidth(medium) clcolor(blue) clcolor(black)
>         ||  line top  JH, clpattern(dash) clwidth(thin) clcolor(black)
>         ||  line bottom JH, clpattern(dash) clwidth(thin) clcolor(black)
>         ||  ,   
>             xlabel(0 1 2 3 4 5 6, labsize(3.5)) 
>             ylabel(-8 -6 -4 -2 0 2 4 6 8 10 , labsize(3.5))
>             yscale(noline)
>             xscale(noline)
>             legend(off)
>         yline(0, lcolor(black)) yline(-8 -6 -4 -2 2 4 6 8 10, lcolor(white))  
>             xtitle(Effective Number of Ethnic Groups, size(4)  )
>         xsca(titlegap(2))
>         ysca(titlegap(2))
>             ytitle("Marginal Effect of Runoff Procedure", size(4))
>         scheme(s2mono) graphregion(fcolor(white));

.         *     ****************************************************************  *;
. *       Runoff system is statistically significant if the effective     *;
. *       number of ethnic groups is greater than 1.9. Afghanistan has    *;
. *       4.01 effective ethnic groups.                                   *;
. *     ****************************************************************  *;
.         gen afghan= b1+b3*4.01;

. display afghan;
1.7712361

. gen afghanse = sqrt(varb1+varb3*4.01^2+2*covb1b3*4.01);

. display afghanse;
.49914709

. gen afghanci_upper=afghan+ afghanse*1.96;

. display afghanci_upper;
2.7495644

. gen afghanci_lower=afghan-afghanse*1.96;

. display afghanci_lower;
.79290777

. *     ****************************************************************  *;
. *       Shifting to a plurality system would reduce the effective       *;
. *       number of presidential candidates by 1.77 [0.79, 2.75].         *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                                   THE END                             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. exit;

end of do-file

.                     log close
       log:  C:\DATA\pres_runoff.log
  log type:  text
 closed on:  18 May 2005, 10:05:08
------------------------------------------------------------------------------------------------------
